package dhbw.GUI.Panels;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

import Main.MyController;

import com.jgoodies.forms.layout.CellConstraints;
import com.jgoodies.forms.layout.FormLayout;

import dhbw.Data.Settings;

public class PanelInfo extends JPanel implements ActionListener{

	private JFrame parent;
	private MyController myc;
	
	public PanelInfo(MyController myc, JFrame parent) {
		this.myc = myc;
		this.parent = parent;
		build();
	}

	public void build() {
		this.setBackground(Settings.BG_COLOR);
		CellConstraints cc = new CellConstraints();
		String cols = "16dlu,pref,16dlu";
		String rows = "6dlu,pref,6dlu,pref,6dlu,pref,6dlu";
		FormLayout grid = new FormLayout(cols, rows);
		this.setLayout(grid);
		this.add(new JLabel(Settings.BIGLOGO_ICON), cc.xy(2, 2));
		this.add(
				new JLabel(
						"<html><div style=\"color:#333333;font-size:16px;\">"
								+ "<b>Team:</b><br>   - Andy B.<br>   - Daniel K.<br>   - Marcus A.<br>   (- Damiano R.)"
								+ "</div></html>"), cc.xy(2, 4));
		JButton bt_close = new JButton("Close");
		bt_close.addActionListener(this);
		this.add(bt_close, cc.xy(2, 6));
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		this.parent.dispose();
	}
	
}
